package com.konsung.ksdc.manager.appmain;

import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import butterknife.ButterKnife;

/**
 * 主界面Fragment基类
 * Created by andy on 2017/4/13.
 */

public abstract class BaseFragment extends Fragment {

    /**
     * 子类事件初始化
     */
    protected abstract void initEvent();

    /**
     * @return 获取子类布局文件ID
     */
    protected abstract int getLayoutId();

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle
            savedInstanceState) {
        View view = View.inflate(getActivity(), getLayoutId(), null);
        ButterKnife.bind(this, view);
        initEvent();
        return view;
    }

}
